home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / IShield for Visual C++ 6.0 / DATA1.CAB / Include_Files / SDSINFOL.RUL < prev    next >
Encoding:
Text File  |  1997-11-20  |  5.1 KB  |  126 lines

  1.  
  2.  /*=======================================================================*/
  3.  /*                                                                       */
  4.  /*           (c) InstallShield Software Corporation (1996-1997)          */
  5.  /*            (c)  InstallShield Corporation  (1990-1996)                */
  6.  /*                       Schaumburg, Illinois 60173                      */
  7.  /*                          All Rights Reserved                          */
  8.  /*                           InstallShield (R)                           */
  9.  /*                                                                       */
  10.  /*   File    : sdsinfol.rul                                              */
  11.  /*                                                                       */
  12.  /*   Purpose : This file contains the code for the SdShowInfoList        */
  13.  /*             script dialog function.                                   */
  14.  /*                                                                       */
  15.  /*=======================================================================*/
  16.  
  17.  /*------------------------------------------------------------------------*/
  18.  /*                                                                        */
  19.  /*   Function: SdShowInfoList                                             */
  20.  /*                                                                        */
  21.  /*   Descrip:  This dialog will show user some predefined infomation      */
  22.  /*                                                                        */
  23.  /*   Misc:                                                                */
  24.  /*                                                                        */
  25.  /*------------------------------------------------------------------------*/
  26. function SdShowInfoList(szTitle, szMsg, list )
  27.           STRING  szDlg, szTemp, svString, svIgnore;
  28.           NUMBER  nId, nTemp, nResult, nvItem;
  29.           BOOL    bDone;
  30.           INT     hwndDlg;
  31.             LIST    nOldlist;
  32.         begin
  33.  
  34.            szDlg     = SD_DLG_SHOWINFOLIST;
  35.            nSdDialog = SD_NDLG_SHOWINFOLIST;
  36.  
  37.           // record data produced by this dialog
  38.           if (MODE=SILENTMODE) then
  39.             SdMakeName( szAppKey, szDlg, szTitle, nSdShowInfoList );
  40.             SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
  41.             return nId;
  42.           endif;
  43.  
  44.            // ensure general initialization is complete
  45.            if (!bSdInit) then
  46.               SdInit();
  47.            endif;
  48.  
  49.            if (EzDefineDialog( szDlg, "", "", SD_NDLG_SHOWINFOLIST ) = DLG_ERR) then
  50.                return -1;
  51.            endif;
  52.  
  53.            // Loop in dialog until the user selects a standard button
  54.            bDone = FALSE;
  55.  
  56.            while (!bDone)
  57.  
  58.               nId = WaitOnDialog( szDlg );
  59.  
  60.               switch(nId)
  61.               case DLG_INIT:
  62.                    hwndDlg = CmdGetHwndDlg( szDlg );
  63.                    SdGeneralInit( szDlg, hwndDlg, STYLE_BOLD, szSdProduct );
  64.  
  65.                    if( szMsg != "" ) then
  66.                        SdSetStatic( szDlg, SD_COMPONENT_MSG, szMsg );
  67.                    endif;
  68.  
  69.                    if(szTitle != "") then
  70.                        SetWindowText(hwndDlg, szTitle);
  71.                    endif;
  72.  
  73.                          nResult = ListCurrentString( list, svIgnore );
  74.  
  75.                          if( nResult < 0 && nResult != END_OF_LIST ) then
  76.                                 nOldlist = list;
  77.                                 list = ListCreate( STRINGLIST );
  78.  
  79.                                 nResult = ListGetFirstItem( nOldlist, nvItem );
  80.                                 while( nResult != END_OF_LIST && nResult >= 0 )
  81.                                         NumToStr( svString, nvItem );
  82.                                         ListAddString( list, svString, AFTER);
  83.                                         nResult = ListGetNextItem( nOldlist, nvItem );
  84.                                 endwhile;
  85.                          endif;
  86.  
  87.                    CtrlSetMLEText(szDlg, SD_EDIT_INFO, list);
  88.  
  89.               case NEXT:
  90.                    nId    = NEXT;
  91.                    bDone  = TRUE;
  92.  
  93.               case BACK:
  94.                    nId    = BACK;
  95.                    bDone  = TRUE;
  96.  
  97.               case DLG_ERR:
  98.                    SdError( -1, "SdShowInfoList" );
  99.                    nId    = -1;
  100.                    bDone  = TRUE;
  101.  
  102.               case DLG_CLOSE:
  103.                    SdCloseDlg( hwndDlg, nId, bDone );
  104.  
  105.               default:
  106.                    // check standard handling
  107.                    if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  108.                        bDone = TRUE;
  109.                    endif;
  110.               endswitch;
  111.  
  112.            endwhile;
  113.  
  114.            EndDialog( szDlg );
  115.            ReleaseDialog( szDlg );
  116.  
  117.            SdUnInit( );
  118.  
  119.            // record data produced by this dialog
  120.            SdMakeName( szAppKey, szDlg, szTitle, nSdShowInfoList );
  121.            SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  122.  
  123.            return nId;
  124.  
  125.        end;
  126.